
<%@include file="/_checkSession.jsp"%>

<%@ page language="java" import="java.util.*,  Container.*, java.text.SimpleDateFormat" pageEncoding="ISO-8859-1"%>
<%
	Center center = (Center)request.getAttribute("center");
	SimpleDateFormat format = new SimpleDateFormat("MM dd yyyy, HH:mm:ss");
	
	ArrayList<Bid> bids = new ArrayList<Bid>();
	bids = center.getBids();
	
	ArrayList<Transaction> buys = center.getTrans_Buy();
	
	ArrayList<Item> items = new ArrayList<Item>();
	items = center.getItems();
	
	ArrayList<Transaction> sells = center.getTrans_Sell();
%>

<!DOCTYPE html>
<!--[if lt IE 7]>      <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]>         <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]>         <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
    <head>
    
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <title></title>
        <meta name="description" content="">
        <meta name="viewport" content="width=device-width">

        <link rel="stylesheet" href="css/bootstrap.min.css">
        <style>
            body {
                padding-top: 60px;
                padding-bottom: 40px;
            }
        </style>
        <link rel="stylesheet" href="css/bootstrap-responsive.min.css">
        <link rel="stylesheet" href="css/main.css">
        <link href="${pageContext.request.contextPath}/css/epubopzczm55fn4cqrgb14a1c.css?dataUri=true" type="text/css" rel="stylesheet">
		<link href="${pageContext.request.contextPath}/css/cqjtvthoh24nrgx54w13elnqm.css?dataUri=true" type="text/css" rel="stylesheet">

        <script src="js/vendor/modernizr-2.6.2-respond-1.1.0.min.js"></script>

  <link rel="stylesheet" href="css/jquery-ui.css" />
  <script src="js/jquery-1.9.1.js"></script>
  <script src="js/jquery-ui.js"></script>
  <script>
  $(function() {
    $( "#tabs" ).tabs();
  });
  </script>        
        
        
        
    </head>
    <body>
        
 <div class="container">
 <div class="hero-unit">
	<div id="tabs">

		  <ul>
		    <li><a href="#tabs-1">Account</a></li>
		    <li><a href="#tabs-2">Bidding Items</a></li>
		    <li><a href="#tabs-3">Selling Items</a></li>
		    <li><a href="#tabs-4">Bought Items</a></li>
		    <li><a href="#tabs-5">Sold Items</a></li>
		  </ul>
		  <div id="tabs-1">
		  	 <table  >
				<tr><td>Name:</td> <td>&nbsp;</td>  <td><%= center.getUserinfo().getName() %></td></tr> 
				<tr><td>Telephone:</td><td>&nbsp;</td><td><%= center.getUserinfo().getTel()  %></td></tr> 
				<tr><td>address:</td><td>&nbsp;</td><td><%= center.getUserinfo().getAddress() %></td></tr> 
				<tr><td>Email:</td><td>&nbsp;</td><td><%= center.getUserinfo().getEmail() %></td></tr> 
		  	 </table>
		  </div>
		  <div id="tabs-2">
		  	<%
		  		if(bids.size() == 0){
		  	%> 
		  		No bid items!
		  	<%
				}else {
				for (int j = 1; j <= bids.size(); j++) {
					Bid bid = bids.get(j-1);
					%> 
						<table   width="90%"  cellpadding="0" cellspacing="0" bgcolor="#2d2d2d" bordercolor="#254389" >
						<tr><td>No.</td><td><%= j %></td></tr> 
						<tr><td> Item Name: </td>
						<td><a href="RequestProcess?uid=<%= session.getAttribute("uid") %>&sid=<%= session.getAttribute("sid") %>&type=itemDetail&iid=<%=bid.getIid() %>"  class="vip " itemprop="name"><%=bid.getItemname() %></a></td>
						<%-- <td> <%= bid.getItemname() %> </td> --%>
						</tr>
	                	<tr><td> Amount: </td><td>$ <%= ((float)bid.getAmount())/100  %> </td> </tr>
	                	<tr><td> Bid Time: </td> <td> <%=  format.format(bid.getDate()) %> </td>   </tr>
	                	</table> 
						<HR style="FILTER: alpha(opacity=100,finishopacity=0,style=1)" width="80%" color=#987cb9 SIZE=3>
					 <%
				}}
			%>   
		  </div>
		  <div id="tabs-3">
		    <%
			  		if(items.size() == 0){
			  	%> 
			  		No selling items!
		    <%  }else {
				for(int j =1; j <= items.size(); j++)
				{
					Item item = items.get(j-1);
					%> 
	
					
					     <div id="e1-52" class="rs rsw t225"  _sp="p2045573.m1686">				
							<div id="ResultSetItems" class="lnkClr" ><br><br>
								<table  listingId="130927082370" class="li rsittlref shic" r="23" itemprop="offers" itemscope itemtype="http://schema.org/Offer">				
									<tbody class="lyr" itemprop="itemOffered" itemscope itemtype="http://schema.org/Product">
										<tr itemprop="offers" itemscope itemtype="http://schema.org/Offer">
											<td class="pic p225 lt img" iid="130927082370"  rowspan=2>
												<div class="l-shad lftd pshad"><div class="picW"><div class="s225"><b class="dum"></b>
													<%if(item.getImg()==null){ %>
														<img itemprop="image" src="${pageContext.request.contextPath}/img/null.gif" class="img" />
													<%}else{%>														
														<img itemprop="image" src="${pageContext.request.contextPath}/img/<%=item.getImg()%>" class="img" height="220" width="220"/>
													<%}%>
											</div></div></div></td>
											<td class="dtl dtlsp" >
												<div class="ittl">
													<h4><%=item.getName() %></h4>
												</div> 								
												<div class="dyn dynS">					
													<div class="s1">Category:&nbsp;<span class="v"> <%= item.getCategoryname() %></span></div>	
													<div class="s1">Description:&nbsp;<span class="v"><%=item.getDescription() %></span></div>
													<div class="s1">Start Time:&nbsp;<span class="v"><%=format.format(item.getStart()) %></span></div>
													<div class="s1">End Time:&nbsp;<span class="v"><%=format.format(item.getEnd()) %></span></div>
													<div class="s1">Current Price:&nbsp;<span class="v">$ <%=((float)item.getCo())/100 %></span></div>
													<%
														if(0 <= item.getBo()){
															%> <div class="s1">Buyout Price:&nbsp;$ <%=((float)item.getBo())/100 %></div><%
														} else {
															%><div class="s1">Buyout Price:&nbsp;N/A</div>	 <%
														}%>
												</div></td>							
											<td class="prc conprices">
												<div  class="g-b bpo">	
													<%
														if(0 < item.getBidder()){
															%><div class="s1">YES</div>	 <%
														} else {
															%> <div class="s1">N/A</div><%
														}%>			
													<div class="bin"><span><div>Bid ? </div></span></div></div></td>
											<td class='prc conprices'><div  class="g-b bpo">
												<div  class="g-b" itemprop="price"><b>&nbsp;&nbsp;&nbsp;</b><%=j %></div>
												<div class="bin"><span><div>Item Number</div></span></div></div></td>		
						</tr></tbody></table></div></div>
					 	<HR style="FILTER: alpha(opacity=100,finishopacity=0,style=1)" width="80%" color=#987cb9 SIZE=3>
					 <%
				}}
			%>
			    
		  </div>
		 <div id="tabs-4">
		    <%
		  		if(buys.size() == 0){
		  	%> 
		  		No bought items!
		  	<%  }else {
				for (int i = 1; i <= buys.size(); i++) {
					Transaction transbuy = buys.get(i-1);
					%> 
						<table   width="90%"  cellpadding="0" cellspacing="0" bgcolor="2d2d2d" bordercolor="#254389" >
						<tr><td> No.</td><td><%= i %></td></tr> 
						<tr><td> Item Name: </td><td> <%= transbuy.getItemname() %> </td></tr>
	                	<tr><td> Amount: </td><td>$ <%= ((float)transbuy.getAmount())/100  %> </td> </tr>
	                	<tr><td> Seller: </td><td> <%= transbuy.getSellername() %> </td></tr>
	                	<tr><td> Bought Time: </td> <td> <%=  format.format(transbuy.getDate()) %> </td>   </tr>
	                	</table> 
						<HR style="FILTER: alpha(opacity=100,finishopacity=0,style=1)" width="80%" color=#987cb9 SIZE=3>
					 <%
				}}
			%>   
		 </div>
		  <div id="tabs-5">
		  		<%
			  		if(sells.size() == 0){
			  	%> 
			  		No sold items!
			  	<% }else {
					for (int i = 1; i <= sells.size(); i++) {
						Transaction transsell = sells.get(i-1);
						%> 
							<table   width="90%"  cellpadding="0" cellspacing="0" bgcolor="2d2d2d" bordercolor="#254389" >
							<tr><td> No.</td><td><%= i %></td></tr> 
							<tr><td> Item Name: </td><td> <%= transsell.getItemname() %> </td></tr>
		                	<tr><td> Amount: </td><td>$ <%= ((float)transsell. getAmount())/100  %> </td> </tr>
		                	<tr><td> Buyer: </td><td> <%= transsell.getBuyername() %> </td> </tr>
		                	<tr><td> Bought Time: </td> <td> <%=  format.format(transsell.getDate()) %> </td>   </tr>
		                	</table> 
							<HR style="FILTER: alpha(opacity=100,finishopacity=0,style=1)" width="80%" color=#987cb9 SIZE=3>
						 <%
					}}
				%>
		  </div>

<%-- 	  <ul>
	    <li><a href="#tabs-1">Account</a></li>
	    <li><a href="#tabs-2">Bought Items</a></li>
	    <li><a href="#tabs-3">Sold Items</a></li>
	  </ul>
	  <div id="tabs-1">
	    Name: <%= request.getAttribute("username") %><br>
 	    phone: <%= request.getAttribute("telephone") %><br>
	    address: <%= request.getAttribute("address") %><br>
	    email: <%= request.getAttribute("email") %>
	  </div>
	  <div id="tabs-2">
	    <p>Morbi tincidunt, dui sit amet facilisis feugiat, odio metus gravida ante, ut pharetra massa metus id nunc. Duis scelerisque molestie turpis. Sed fringilla, massa eget luctus malesuada, metus eros molestie lectus, ut tempus eros massa ut dolor. Aenean aliquet fringilla sem. Suspendisse sed ligula in ligula suscipit aliquam. Praesent in eros vestibulum mi adipiscing adipiscing. Morbi facilisis. Curabitur ornare consequat nunc. Aenean vel metus. Ut posuere viverra nulla. Aliquam erat volutpat. Pellentesque convallis. Maecenas feugiat, tellus pellentesque pretium posuere, felis lorem euismod felis, eu ornare leo nisi vel felis. Mauris consectetur tortor et purus.</p>
	  </div>
	  <div id="tabs-3">
	    <p>Mauris eleifend est et turpis. Duis id erat. Suspendisse potenti. Aliquam vulputate, pede vel vehicula accumsan, mi neque rutrum erat, eu congue orci lorem eget lorem. Vestibulum non ante. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Fusce sodales. Quisque eu urna vel enim commodo pellentesque. Praesent eu risus hendrerit ligula tempus pretium. Curabitur lorem enim, pretium nec, feugiat nec, luctus a, lacus.</p>
	    <p>Duis cursus. Maecenas ligula eros, blandit nec, pharetra at, semper at, magna. Nullam ac lacus. Nulla facilisi. Praesent viverra justo vitae neque. Praesent blandit adipiscing velit. Suspendisse potenti. Donec mattis, pede vel pharetra blandit, magna ligula faucibus eros, id euismod lacus dolor eget odio. Nam scelerisque. Donec non libero sed nulla mattis commodo. Ut sagittis. Donec nisi lectus, feugiat porttitor, tempor ac, tempor vitae, pede. Aenean vehicula velit eu tellus interdum rutrum. Maecenas commodo. Pellentesque nec elit. Fusce in lacus. Vivamus a libero vitae lectus hendrerit hendrerit.</p>
	  </div> --%>
	  
	</div>
	
</div>
</div>




<!-- 
        <script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
        <script>window.jQuery || document.write('<script src="js/vendor/jquery-1.9.1.min.js"><\/script>')</script>

        <script src="js/vendor/bootstrap.min.js"></script>

        <script src="js/main.js"></script>

        <script>
            var _gaq=[['_setAccount','UA-XXXXX-X'],['_trackPageview']];
            (function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];
            g.src=('https:'==location.protocol?'//ssl':'//www')+'.google-analytics.com/ga.js';
            s.parentNode.insertBefore(g,s)}(document,'script'));
        </script>
        
 --> 
 
        
    </body>
</html>
